<?php
MYTCONN();
 $HDCMD = 'RD';
 $AMLDocs = $GLOBALS['MYT']->db_array("SELECT *, main_users.name AS User, main_offices.name AS Office FROM hd_docdocumentos
	  		INNER JOIN hd_doctipos ON dnc_ID = dnl_TipoDoc
			LEFT OUTER JOIN systemoffice.main_offices ON main_offices.ref = dnl_OFFICE
			LEFT OUTER JOIN systemoffice.main_users ON main_users.ref =  dnl_Usuario
			INNER JOIN hd_sysstatus ON stt_ID = dnl_Activo
			LEFT OUTER JOIN hd_amlalertas ON amh_ID = dnl_AML
	   WHERE dnl_ID = {$_GET['RSID']}");
	if (isset($AMLDocs[1]['amh_Status']) && $AMLDocs[1]['amh_Status'] < 0) { $HDCMD = 'ED'; }
echo '
<div id="Doc_ActionED"></div>
<table width="100%"  border="0" cellspacing="5" cellpadding="5">
  <tr>
    <td>N&uacute;mero do Documento </td>
    <td>'.$AMLDocs[1]['dnl_ID'].'</td>
  </tr>
  <tr>
    <td>Tipologia</td>
    <td>';
	$Qur = "SELECT dnc_Doc AS NAME, dnc_ID AS ID FROM hd_doctipos WHERE dnc_Country = {$__sys['Country']} AND dnc_Activo = 1";
	 mn_field('select',$HDCMD,'dnc_Doc',$AMLDocs[1]['dnl_TipoDoc'],$Qur,$AMLDocs[1]['dnc_Doc'],'','" onchange="
		document.AMLEdit.OBJCT_TYPE.value=this.value;
		document.AMLEdit.OBJCT_ID.value='.$_GET['RSID'].';
		document.AMLEdit.action=\'_response/call.php?get=Compliance/doc_pract2\';
		subform(\'AMLEdit\',\'Doc_ActionED\');');
echo '</td>
  </tr>
  <tr>
    <td>Descri&ccedil;&atilde;o</td>
    <td>'.$AMLDocs[1]['stt_Aux'].'</td>
  </tr>
  <tr>
    <td>Funcionario:</td>
    <td>'.$AMLDocs[1]['User'].'</td>
  </tr>
  <tr>
    <td colspan="2"><hr width="100%" height="1" /></td>
  </tr>
  <tr>
    <td>Arquivo Fisico:</td>
    <td>'.$AMLDocs[1]['Office'].'</td>
  </tr>
  <tr>
    <td valign="top">Arquivo Digital:</td>
    <td>'.$AMLDocs[1]['dnl_FILE'].' <br>
    Tamanho do Arquivo: 0Kb<br>
    Formato: <br>
    Dimens&otilde;es:
	<p>P�ginas Adicionais:</td>
  </tr>
  <tr>
    <td>Estado:</td>
    <td>'.$AMLDocs[1]['stt_Word'].'</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>';
	mn_field('button',$HDCMD,'HDC_DEL','Remover','','','','BUTTON" onclick="
		if (confirm(\'Vai remover este documento, pretende continuar?\')==true) {
		document.AMLEdit.OBJCT_ID.value='.$_GET['RSID'].';
		document.AMLEdit.action=\'_response/call.php?get=Compliance/doc_pract2\';
		subform(\'AMLEdit\',\'DocView\');
		Ext.onReady(function(){
			Ext.getCmp(\'win-editdoc\').close();
			});
		}');
	echo '</td>
  </tr>
</table>
';